package xyz.lne.researchgroupmanage.controller.request;

import lombok.Data;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Designed By Lne.
 * 2021/1/20 14:01
 */
@Data
public class UserRequest {
    private String account;
    private String password;
    private String email;
    private String name;
    private String phoneNumber;
    private Integer sex;
    private Date birthday;
    private String company;
    private String position;
    private String introduction;
    private String userImg;

/*    public String getBirthdayString(){
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        String birthdayString = df.format(this.getBirthday());
        return birthdayString;
    }*/

    public void setBirthday(String date) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
        Date utilDate = new Date();
        try {
            utilDate = sdf.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        this.birthday= new java.sql.Date(utilDate.getTime());
    }
}

